package org.zhs.flowable.demo.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.zhs.flowable.demo.entity.TestEntity;
import org.zhs.flowable.demo.service.TestEntityService;

import java.util.List;

/**
 * @Author: zhs
 * @Date: 2024/4/11 21:17
 * @Version: 1.0
 * @Description:
 */

@RestController
@RequestMapping("/test")
public class TestController {

    @Autowired
    private TestEntityService testEntityService;


    @RequestMapping("/get/{id}")
    public TestEntity get(@PathVariable("id") String id){
        return testEntityService.get(id);
    }

    @RequestMapping("/insert")
    public void insert(){
        testEntityService.save(new TestEntity());
    }

    @RequestMapping("/list")
    public List<TestEntity> list(){
        return testEntityService.list();
    }

}
